<template>
  <div class="about">
    <header>搜索</header>
    <search-input></search-input>
    <div class="exent">
      <span class="left">搜索历史</span>
      <span @click="delect">清空历史</span>
    </div>
    <ul class="history">
      <li v-for="(item,index) in $store.state.historyList" :key="index">{{item}}</li>
      
    </ul>
  </div>
</template>

<script>
import searchInput from '../components/searInput.vue'
export default {
  components:{
    searchInput
  },
  data(){
    return {
     
    }
  },
  methods: {
    
    delect(){
      this.$store.commit('clear');
    }
  },
}
</script>
<style lang="scss">
  .search{
    display: flex;
    // background: #ccc;
    height: 80px;
    align-items: center;
    input{
      flex: 1;
      border: none;
      background: #f0f0f0;
      height: 40px;
      padding: 0 10px;
      
    }
    span{
      width: 60px;
      // height: 80%;
      text-align: center;
      background: #7277e0;
      color: #fff;
      padding: 8px 0;
    }
  }
  .exent{
    height: 45px;
    background:  #7277e0;
    color: #fff;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    .left{
      font-size: 14px;
      font-weight: 900;
    }
  }
  .history{
     display: flex;
     flex-wrap: wrap;
     margin-top: 20px;
     li{
       padding: 6px 0;
       width: 60px;
       border: 1px solid #ccc;
       border-radius: 3px;
       text-align: center;
       font-size: 12px;
       margin-left: 10px;
     }
  }
</style>
